<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var date = new Date()

    var h = date.getHours()
    h = h >= 10 ? h : '0' + h

    var m = date.getMinutes()
    m = m >= 10 ? m : '0' + m

    var s = date.getSeconds() + ''
    s = s.padStart(2, 0)

    var str = h + ':' + m + ':' + s

    console.log(str)
  </script>
</body>
</html>